<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib prefix="s"  uri="/struts-tags"%>

<script type="text/javascript" src="<%=request.getContextPath()%>/js/common/money2chinese.js"></script>
<title>质押合同生成</title><span id="navlink">&nbsp;&nbsp;&nbsp; 合同管理 &gt;&gt;合同生成&gt;&gt;质押合同生成</span>

<script type="text/javascript" src="<%=request.getContextPath()%>/js/contract/contractPledge.js"></script>
<div id="msg"></div>

<form action="contractRelationNew!SaveinPledge" method="post" id="form">
<s:hidden id="money" value="%{things.collateralvalueidentification }"/>
<table class="table_box table_all" cellspacing="0" cellpadding="0">
<tr>
	<td align="right"><span class="need">*</span>合同编号<input type="text" name="contractY" value="${contractY }" size="5"/>年
	<select name="contractpledge.pledgetype">
		<option value="">-----</option>
		<s:if test='F=="1"'>
		<option value="1" selected="true">个质</option>
		</s:if><s:else><option value="1">个质</option></s:else>
		<s:if test='F=="2"'>
		<option value="2" selected="true">企质</option>
		</s:if><s:else><option value="2">企质</option></s:else>
	</select>字第
	<input type="text" name="contractnumber" value="<s:text name="f.number"><s:param value="contractnumber"/></s:text>" size="10"/>号
	</td>
</tr>
</table>
<table class="table_box table_all_border" cellspacing="0" cellpadding="0">
<tr>
	<td align="right" style="width:20%">合同名称</td>
	<td style="width:30%"><input type="text" name="contractpledge.pledgename" value=""/></td>
	<td align="right" style="width:20%">出质人</td>
	<td style="width:30%"><input type="text" name="customname" value="${customname }" class="readonly" readonly="ture"/></td>
</tr>
<tr>
	<td align="right">证件种类</td>
	<td><s:select name="cardtype"  list="codetypelist" listKey="id" listValue="  name" 
						label="选择证件类型" headerKey="0" headerValue="----选择证件类型----" value="codetype" /></td>
	<td align="right">证件号码</td>
	<td><input type="text" name="customcode" value="${customcode }" class="readonly" readonly="ture"/></td>
</tr>
<tr>
	<td align="right">地址</td>
	<td colspan="3"><input type="text" name="address" value="${address }" style="width:50%" class="readonly" readonly="ture"/></td>
</tr>
<tr>
	<td align="right">电话</td>
	<td><input type="text" name="phone" value="${phone }" class="readonly" readonly="ture"/></td>
	<td align="right">传真</td>
	<td><input type="text" name="fax" value="${fax }" class="readonly" readonly="ture"/></td>
</tr>
<tr>
	<td align="right">法定代表人</td>
	<td><input type="text" name="Legalrepresentative" value="${Legalrepresentative }" class="readonly" readonly="ture"/></td>
	<td align="right">职务</td>
	<td><input type="text" name="position" value="${position }" class="readonly" readonly="ture"/></td>
</tr>
<tr>
	<td align="right">债务人</td>
	<td><input type="text" name="loanname" value="${loanname }" class="readonly" readonly="ture"/></td>
	<td align="right">出质人配偶</td>
	<td><input type="text" name="  nameofspouse" value="${nameofspouse }" class="readonly" readonly="ture"/></td>
</tr>
<tr>
	<td align="right"><span class="need">*</span>质押金额</td>
	<td colspan="3">人民币<input type="text" id="srcLower" name="contractpledge.pledgemoney" value=""/>大写<input type="text" id="toUpper" class="readonly" readonly="true" name="" value=""style="width:50%"/></td>
</tr>
<tr>
	<td align="right"><span class="need">*</span>质押期限</td>
	<td colspan="3">&nbsp;&nbsp;&nbsp;自<input type="text" class="datepicker" name="contractpledge.start" value=""/>&nbsp;&nbsp;&nbsp;至&nbsp;&nbsp;&nbsp;<input type="text" class="datepicker" name="contractpledge.end" value=""/></td>
</tr>
<tr>
	<td align="right">质押标名称</td>
	<td><input type="text" name="thingsname" value="${things.collateralname }" class="readonly" readonly="ture"/></td>
	<td align="right">质押标数量</td>
	<td><input type="text" name="thingsquantity" value="${things.collateralnumber }" class="readonly" readonly="ture"/></td>
</tr>
<tr>
	<td align="right">质押标的产权</td>
	<td><input type="text" name="authority" value="${things.ownershipofcollateral }" class="readonly" readonly="ture"/></td>
	<td align="right">产权证号码</td>
	<td><input type="text" name="certificatenumber" value="${things.propertyrightcardnumber }" class="readonly" readonly="ture"/></td>
</tr>
<tr>
	<td align="right">质押标所在地</td>
	<td colspan="3"><input type="text" name="" value="${things.collateralislocated }" style="width:50%" class="readonly" readonly="ture"/></td>
</tr>
<tr>
	<td align="right">出质人对质押标的拥有份额</td>
	<td><input type="text" name="sharepercentage" value="${things.mortgagorshareofcollateral }" class="readonly" readonly="ture"/></td>
	<td align="right">其他共有人</td>
	<td><input type="text" name="" value="${things.otherpeoplesname }" class="readonly" readonly="ture"/></td>
</tr>
<tr>
	<td align="right">质押标其他状况</td>
	<td colspan="3"><input type="text" name="" value="${things.otherconditionscollateral }" style="width:50%" class="readonly" readonly="ture"/></td>
</tr>
<tr>
	<td align="right">备注</td>
	<td colspan="3"><input type="text" name="" value="${things.remarks }" style="width:50%" class="readonly" readonly="ture"/></td>
</tr>
<tr>
	<td align="right"><span class="need">*</span>合同签订日期</td>
	<td colspan="3"><input type="text" class="datepicker" name="contractpledge.contractensuredate" value=""/></td>
</tr>
<%--<tr>
	<td align="right">业务员</td>
	<td><input type="text" name="" value=""/></td>
	<td align="right">操作日期</td>
	<td><input type="text" name="contractpledge.createtime" value="<s:text name="f.date.ymd"><s:param value="curenttime"/></s:text>" class="readonly" readonly="ture"/></td>
</tr>
--%></table>
<div id="button_area">
	<input type="hidden" name="relationid" value="${relationid }"/>
	<div><input type="submit" value="下一步"/></div></div>
</form>
<script>
$(function() {
	//$("#srcLower").keyup(function(){show_percent()});
	//$("#srcLower").change(function(){show_percent()});
	$("#srcLower").bind("keyup click",function(){show_percent()});
	
});

function show_percent(){
	var  toUpper = $("#toUpper");
	toUpper.css("color","#000");
	var n=$("#srcLower");
	var num =n.val();
	var a = num.match(/\d*\.?\d{0,2}/,'$1');
	if(a!=$.trim(num)){
		toUpper.val("输入有误!!")
		toUpper.css("color","red");
		return;
	}
	var fmoney =  $("#money").val();
	if (parseInt(num)>parseInt(fmoney)) {
		n.val(fmoney);
		num=fmoney;
		alert("对不起，您的抵押金额超过了抵押物的认定价值"+fmoney);
	}
	var upperValue = Money.toUpper($.trim(num));
	toUpper.val(upperValue);
}
</script>
